<template>
  <div>
    <div class="box1" @click="show">
      <p>表单选择项</p>
      <div>
        <p v-if="isShow">v</p>
        <p v-else>></p>
      </div>
    </div>
    <div v-show="isShow" class="box2">
      <p>表单提交项</p>
      <div class="box3" @click="showStyle"></div>
    </div>

    <div>
      <p>上面效果是我机试书写代码</p>
      <p>机试</p>
      <p>1.实现盒子拖拽</p>
      <p>2.点击展开子盒子，用css画三角形作为右箭头和下箭头</p>
      <p>3.用css写出element ui滑块组件，能够点击切换</p>
      <p>4.加分项：拖拽功能封装自定义指令</p>
      <p>5.加分项：使用mixin抽离复用逻辑</p>
      <p>技术面</p>
      <p>自我介绍</p>
      <p>讲一下项目</p>
      <p>你知道websoket吗</p>
      <p>说一下js高阶函数（forEacth）</p>
      <p>按钮权限怎么实现的</p>
      <p>vue2的响应式原理</p>
      <p>vue2和vue3的区别</p>
      <p>项目中的难点</p>
      <p>mixin混入</p>
      <p>做过哪些性能优化</p>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isShow: false,
      showstyle: true,
    }
  },
  methods: {
    show() {
      this.isShow = !this.isShow
    },
    showStyle(e) {
      if (this.showstyle) {
        e.target.style.background = "#fff"
        this.showstyle = false
      } else {
        e.target.style.background = "red"
        this.showstyle = true
      }
    },
  },
}
</script>

<style>
.box1 {
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  width: 200px;
  height: 50px;
  background-color: red;
  color: #fff;
}
.box2 {
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  width: 200px;
  height: 50px;
  background-color: blue;
  color: #fff;
}
.box3 {
  margin-top: 15px;
  width: 50px;
  height: 20px;
  background-color: red;
}
</style>
